<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->comment("评论用户ID");
            $table->integer('good_id')->comment("所属商品");
            $table->tinyInteger('rate')->default(1)->comment("评论级别 1好【2中】3差");
            $table->string('content')->comment("评论内容");
            $table->string('reply')->nullable()->comment("商家回复");
            $table->json('pics')->nullable()->comment("评论图片");
            $table->timestamps();
        });
    }
    public function down(): void
    {
        Schema::dropIfExists('comments');
    }
};
